package com.hundsun.cprs.yyt.service.common.enums;

import java.util.HashMap;
import java.util.Map;

import com.hundsun.hps.enums.EnumTransCode;

/**
 * 资金订单业务码
 * 
 * @author linbo
 * @version $Id: EnumFundCode.java,v 1.1.2.1-RC1 2017年12月25日 Exp $
 */
public enum EnumFundBidCode {

	CFUND_170101("170101", "易亿通系统交易收入",EnumTransCode.TXCODE_FUND_IN,"交易收入"),
	CFUND_170102("170102", "易亿通系统交易收入",EnumTransCode.TXCODE_FUND_IN,"退货收入"),
	CFUND_170201("170201", "易亿通系统交易支出",EnumTransCode.TXCODE_FUND_OUT,"交易支出"),
	CFUND_170301("170301", "易亿通系统交易冻结",EnumTransCode.TXCODE_FREEZE,"资金冻结"),
	CFUND_170401("170401", "易亿通系统交易解冻",EnumTransCode.TXCODE_UN_FREEZE,"资金解冻"),
	CFUND_170701("170701", "易亿通系统交易手续费支出",EnumTransCode.TXCODE_FUND_PAY_EXCHANGE,"交易手续费支出"),
	CFUND_170702("170702", "易亿通系统交易综合管理费",EnumTransCode.TXCODE_FUND_PAY_EXCHANGE,"综合管理费支出"),
	CFUND_171201("171201", "易亿通交易佣金支出",EnumTransCode.TXCODE_OTHER_FUND_OUT,"交易佣金支出"),


	//入金,出金的固定子代码，兼容展示
	CFUND_010105("010105", "易亿通系统充值",EnumTransCode.TXCODE_BANK_FUND_IN,"充值"),
	CFUND_010201("010201", "易亿通系统提现",EnumTransCode.TXCODE_BANK_FUND_OUT,"提现"),
	//出入金手续费的转换
	CFUND_020701("020701", "出入金手续费",EnumTransCode.TXCODE_FUND_PAY_EXCHANGE,"支付手续费"),
	CFUND_020702("020702", "出入金手续费",EnumTransCode.TXCODE_FUND_PAY_EXCHANGE,"支付手续费"),
	CFUND_170801("170801", "佣金收入",EnumTransCode.TXCODE_FUND_PAY_EXCHANGE,"佣金收入"),
	;

	/** 资金子业务编码 */
	private String noCode;
	/** 资金子业务编码说明 */
	private String noInfo;
	/** 资金系统的操作类型 */
	private EnumTransCode transCode;
	/** 操作类型别名描述(用于简化展示) */
	private String aliasInfo;

	private EnumFundBidCode(String noCode, String noInfo,EnumTransCode transCode,String aliasInfo) {
		this.noCode = noCode;
		this.noInfo = noInfo;
		this.transCode = transCode;
		this.aliasInfo = aliasInfo;
	}

	/**
	 * 全局索引池
	 */
	private static Map<String, EnumFundBidCode> pool = new HashMap<String, EnumFundBidCode>();
	static {
		for (EnumFundBidCode et : EnumFundBidCode.values()) {
			pool.put(et.noCode + "", et);
		}
	}

	/**
	 * 根据内容索引
	 * 
	 * @param code
	 * @return
	 */
	public static EnumFundBidCode indexByValue(String errorNo) {
		return pool.get(errorNo);
	}

	public String getNoCode() {
		return noCode;
	}

	public String getNoInfo() {
		return noInfo;
	}

    public EnumTransCode getTransCode() {
        return transCode;
    }

    public String getAliasInfo() {
        return aliasInfo;
    }

}
